package com.dsteiner.widgets.client.rpc;

import java.util.ArrayList;
import java.util.List;

import com.dsteiner.widgets.client.domain.BaseObject;
import com.google.gwt.user.client.rpc.IsSerializable;

public class SearchResult<T extends BaseObject> extends BaseObject{

	private List<T> modelObjects = new ArrayList<T>();
	private int count;

	public SearchResult() {
	}
	
	public int getCount() {
		return count;
	}
	public void setCount(int count) {
		this.count = count;
	}
	public List<T> getObjects() {
		return modelObjects;
	}
	public void setObjects(List<T> objects) {
		this.modelObjects = objects;
	}

	public void add(SearchResult<T> searchResult) {
		modelObjects.addAll(searchResult.getObjects());
		count += searchResult.getCount();
	}
}
